package com.huaruan.youdi.views.activitys;


import android.os.Bundle;
import android.widget.TextView;

import com.huaruan.youdi.R;
import com.huaruan.youdi.models.AppealModel;

import butterknife.BindView;

public class AppealDetailActivity extends BaseActivity {
    @BindView(R.id.tv_code)
    TextView tv_code;
    @BindView(R.id.tv_date)
    TextView tv_date;
    @BindView(R.id.tv_send_name)
    TextView tv_send_name;
    @BindView(R.id.tv_send_phone)
    TextView tv_send_phone;
    @BindView(R.id.tv_send_address)
    TextView tv_send_address;
    @BindView(R.id.tv_receive_name)
    TextView tv_receive_name;
    @BindView(R.id.tv_receive_phone)
    TextView tv_receive_phone;
    @BindView(R.id.tv_receive_address)
    TextView tv_receive_address;
    @BindView(R.id.tv_cause)
    TextView tv_cause;
    @BindView(R.id.tv_detail)
    TextView tv_detail;


    private AppealModel model;

    @Override
    public int IGetContentViewResId() {
        return R.layout.activity_appeal_detail;
    }

    @Override
    public void IFindViews() {
        Bundle bundle = getIntent().getExtras();
        model = (AppealModel)bundle.getSerializable("model");
    }

    @Override
    public void IInitData() {
        tv_code.setText(model.timelyWaybill.tmNo);
        tv_date.setText(model.complaint.createTime);
        tv_send_name.setText(model.timelyWaybill.sender);
        tv_send_phone.setText(model.timelyWaybill.senderPhone);
        tv_send_address.setText(model.timelyWaybill.senderAddress);
        tv_receive_name.setText(model.timelyWaybill.receiver);
        tv_receive_phone.setText(model.timelyWaybill.receiverPhone);
        tv_receive_address.setText(model.timelyWaybill.receiverAddress);
        if ("0".equals(model.complaint.destroyCause)) {
            tv_cause.setText("销单原因: 业务员原因");
        } else if ("1".equals(model.complaint.destroyCause)) {
            tv_cause.setText("销单原因: 客户自身原因");
        } else if ("2".equals(model.complaint.destroyCause)) {
            tv_cause.setText("销单原因: 天气原因");
        } else if ("3".equals(model.complaint.destroyCause)) {
            tv_cause.setText("销单原因: 其他原因");
        }
        tv_detail.setText(model.complaint.detail);
    }
}
